#define _GNU_SOURCE
#include <stdio.h>
#include <sched.h>
#include <unistd.h>
#include <stddef.h>
#include <stdlib.h>

typedef struct ListNode {
    int data;
    struct ListNode *next;
    int count[5024000];
} ListNode;

int daemon_forever(void)
{
    int count = 0;
    ListNode *head = NULL;
    ListNode *new_node = NULL;
    fprintf(stdout, "sizeof(ListNode) = %lu\n", sizeof(ListNode));
    sleep(8);
    while(1) {
        new_node = (ListNode *)malloc(sizeof(ListNode));
        if (new_node == NULL) {
            fprintf(stdout, "malloc error %d\n", count);
        }
        new_node->data = count;
        new_node->next = head;
        head = new_node;
        printf("malloc %d %p\n", count, new_node);
        count++;
        // sleep(1);
    }
    return 0;
}
